package com.jinglin.entity.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 分类信息
 * </p>
 *
 * @author ${author}
 * @since 2025-03-06
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="CategoryInfo对象", description="分类信息")
public class CategoryInfo extends Model<CategoryInfo> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "分类ID")
      @TableId(value = "category_id")
    private String categoryId;

    @ApiModelProperty(value = "分类编码")
    private String categoryCode;

    @ApiModelProperty(value = "分类名称")
    private String categoryName;

    @ApiModelProperty(value = "父级分类ID")
    private String pCategoryId;

    @ApiModelProperty(value = "图标")
    private String icon;

    @ApiModelProperty(value = "背景图")
    private String background;

    @ApiModelProperty(value = "排序号")
    private Integer sort;

    @TableLogic(value = "0", delval = "1")
    private Integer deleted;

    @TableField(exist = false)
    private List<CategoryInfo> children;


    @Override
    protected Serializable pkVal() {
        return this.categoryId;
    }

}
